# include <stdio.h>
int main ()
{
	int n;
	scanf("%d",&n);
	while(n--)
	{
		int x,y,a,b,c;
		scanf("%d",&x);
		scanf("%d",&y);
		for(a=0;a<=x;a++)
		{
			for(b=0;b<=x;b++)
			{
				for(c=0;c<=x;c++)
				{
            if(a+b+c==x&&3*a+2*b+c==y)
				printf("%d %d %d\n",a,b,c);

				}
			}
		}
		
	}

		return 0;
}


		